<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "city_4".
 *
 * @property int $id 区划代码
 * @property string|null $name 名称
 * @property int|null $pid 父级区划代码
 * @property int|null $level 级别: 1-省/直辖市, 2-市, 3-区/县/地级市, 4-街道/镇, 5-社区/乡村
 */
class City4 extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'city_4';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['id', 'pid', 'level'], 'integer'],
            [['name'], 'string', 'max' => 50],
            [['id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'pid' => 'Pid',
            'level' => 'Level',
        ];
    }
}
